<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.2.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">
  <link rel="stylesheet" href="/lib/pace/pace-theme-minimal.min.css">
  <script src="/lib/pace/pace.min.js"></script>

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"sekla.cn","root":"/","scheme":"Muse","version":"7.8.0","exturl":false,"sidebar":{"position":"right","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":"valine","storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="实验环境window10 64bit，Debug工具 实验目的本实验为课程预备实验，要求成功安装Debug基本环境，从而为后续课程实验搭建基础运行平台。 实验内容第一段程序1.指令，寄存器，内存单元，基本DOS操作。a.下载Debug工具，搭建环境 进入官网下载DOSBox，安装后开启。 1.输入debug，出现illegal command:debug 原因：未设置目录，输入指令设置目录并模拟C">
<meta property="og:type" content="article">
<meta property="og:title" content="预备--一些简单汇编代码与debug操作">
<meta property="og:url" content="http://sekla.cn/2021/04/14/csapp-lab0-1/index.html">
<meta property="og:site_name" content="Sekla&#39;s Blog">
<meta property="og:description" content="实验环境window10 64bit，Debug工具 实验目的本实验为课程预备实验，要求成功安装Debug基本环境，从而为后续课程实验搭建基础运行平台。 实验内容第一段程序1.指令，寄存器，内存单元，基本DOS操作。a.下载Debug工具，搭建环境 进入官网下载DOSBox，安装后开启。 1.输入debug，出现illegal command:debug 原因：未设置目录，输入指令设置目录并模拟C">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://i.loli.net/2021/04/14/FpqEHeKLd1rRM4C.png">
<meta property="og:image" content="https://i.loli.net/2021/04/14/rVl4Hn8jcs7Xt6L.png">
<meta property="og:image" content="https://i.loli.net/2021/04/14/rVl4Hn8jcs7Xt6L.png">
<meta property="og:image" content="https://i.loli.net/2021/04/14/uvfoZhmyWT8qHzC.png">
<meta property="og:image" content="https://i.loli.net/2021/04/14/TLfRkM1alEG3qzw.png">
<meta property="og:image" content="https://i.loli.net/2021/04/14/vMyru7ijmX1fCQd.png">
<meta property="og:image" content="https://i.loli.net/2021/04/14/n9YRP3AEDlm1i5p.png">
<meta property="og:image" content="https://i.loli.net/2021/04/14/wKv2NyhOTYzijSP.png">
<meta property="og:image" content="https://i.loli.net/2021/04/14/W6I8DpGPn52vMct.png">
<meta property="og:image" content="https://i.loli.net/2021/04/14/jsuUoT1kfpExXY7.png">
<meta property="article:published_time" content="2021-04-14T08:09:30.000Z">
<meta property="article:modified_time" content="2021-10-18T14:44:23.505Z">
<meta property="article:author" content="Sekla">
<meta property="article:tag" content="汇编">
<meta property="article:tag" content="debug">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://i.loli.net/2021/04/14/FpqEHeKLd1rRM4C.png">

<link rel="canonical" href="http://sekla.cn/2021/04/14/csapp-lab0-1/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>预备--一些简单汇编代码与debug操作 | Sekla's Blog</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

  <script type="text/javascript" src="/js/my_js/clicklove.js"></script>
<!-- hexo injector head_end start -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css">

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/hexo-math@4.0.0/dist/style.css">
<!-- hexo injector head_end end --></head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">Sekla's Blog</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">Keep Learning Keep Doing</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签<span class="badge">14</span></a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类<span class="badge">23</span></a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档<span class="badge">100</span></a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://sekla.cn/2021/04/14/csapp-lab0-1/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.jpg">
      <meta itemprop="name" content="Sekla">
      <meta itemprop="description" content="Sekla">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Sekla's Blog">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          预备--一些简单汇编代码与debug操作
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2021-04-14 16:09:30" itemprop="dateCreated datePublished" datetime="2021-04-14T16:09:30+08:00">2021-04-14</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2021-10-18 22:44:23" itemprop="dateModified" datetime="2021-10-18T22:44:23+08:00">2021-10-18</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%B3%BB%E7%BB%9F/" itemprop="url" rel="index"><span itemprop="name">计算机系统</span></a>
                </span>
                  ，
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%B3%BB%E7%BB%9F/CSAPP%E5%AE%9E%E9%AA%8C%E7%B3%BB%E5%88%97/" itemprop="url" rel="index"><span itemprop="name">CSAPP实验系列</span></a>
                </span>
            </span>

          
            <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span id="busuanzi_value_page_pv"></span>
            </span><br>
            <span class="post-meta-item" title="本文字数">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">本文字数：</span>
              <span>2.3k</span>
            </span>
            <span class="post-meta-item" title="阅读时长">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">阅读时长 &asymp;</span>
              <span>2 分钟</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h3 id="实验环境"><a href="#实验环境" class="headerlink" title="实验环境"></a>实验环境</h3><p>window10 64bit，Debug工具</p>
<h3 id="实验目的"><a href="#实验目的" class="headerlink" title="实验目的"></a>实验目的</h3><p>本实验为课程预备实验，要求成功安装Debug基本环境，从而为后续课程实验搭建基础运行平台。</p>
<h3 id="实验内容"><a href="#实验内容" class="headerlink" title="实验内容"></a>实验内容</h3><h4 id="第一段程序"><a href="#第一段程序" class="headerlink" title="第一段程序"></a>第一段程序</h4><h4 id="1-指令，寄存器，内存单元，基本DOS操作。"><a href="#1-指令，寄存器，内存单元，基本DOS操作。" class="headerlink" title="1.指令，寄存器，内存单元，基本DOS操作。"></a>1.指令，寄存器，内存单元，基本DOS操作。</h4><p><strong>a.下载Debug工具，搭建环境</strong></p>
<p>进入官网下载DOSBox，安装后开启。</p>
<p>1.输入debug，出现<code>illegal command:debug</code></p>
<p>原因：未设置目录，输入指令设置目录并模拟C盘，将debug.exe放入。需要配置环境。</p>
<p>首先设置了目录D:\debug为debug目录，并放入debug.exe，打开DOSBox安装目录发现帮助文件打开知道：</p>
<blockquote>
<p>START: How to start?<br>At the beginning you’ve got a Z:&gt; instead of a C:&gt; at the prompt.<br>You have to make your directories available as drives in DOSBox by using<br>the “mount” command. For example, in Windows “mount C D:\GAMES” will give<br>you a C drive in DOSBox which points to your Windows D:\GAMES directory<br>(that was created before). In Linux, “mount c /home/username” will give you<br>a C drive in DOSBox which points to /home/username in Linux.<br>To change to the drive mounted like above, type “C:”. If everything went<br>fine, DOSBox will display the prompt “C:&gt;“.</p>
</blockquote>
<p>我们需要设置一个可用目录作为硬盘，并使用mount命令来虚拟C盘，成功将是C:&gt;符号，按照help操作，输入以下命令：</p>
<p><img src="https://i.loli.net/2021/04/14/FpqEHeKLd1rRM4C.png"></p>
<a id="more"></a>

<p>此时输入debug指令成功。此时每次重新打开DOS都需要重新配置，所以：</p>
<blockquote>
<p>The configuration file is automatically created the first time you run DOSBox.<br>The file can be found in:<br>(Windows)  “Start/WinLogo Menu”-&gt;”All Programs”-&gt;”DOSBox-0.74-3”-&gt;Options<br>(Linux)    <del>/.dosbox/dosbox-0.74-3.conf<br>(MAC OS X) “</del>/Library/Preferences/DOSBox 0.74-3 Preferences”<br>The file is divided into several sections. Each section starts with a<br>[section name] line. The settings are the property=value lines where value can<br>be altered to customize DOSBox.</p>
<p># and % indicate comment-lines.d</p>
</blockquote>
<p>按照提示配置脚本即可。</p>
<p><strong>b.开始debug与第一个汇编程序</strong></p>
<p>按照试验要求汇编后，运行发现DOSBox未响应。</p>
<p>重新开始一次，输入汇编代码后运行，发现依然未响应。查询百度后发现：</p>
<p><strong>1.程序错误 2.无偏移地址</strong></p>
<p>了解之后发现</p>
<p><strong>INT 20指令执行需要条件，可能是某个函数，所以需要设置ah寄存器为4c即MOV ah，4c，可以用int 21代替</strong></p>
<p>DOS环境下：</p>
<table>
<thead>
<tr>
<th>I/O ADDR</th>
<th>INT TYPE（16进制）</th>
<th>FUNCTION</th>
</tr>
</thead>
<tbody><tr>
<td>80 ~ 83</td>
<td>20</td>
<td>DOS 中断返回</td>
</tr>
<tr>
<td>84 ~ 87</td>
<td>21</td>
<td>DOS 系统功能调用</td>
</tr>
</tbody></table>
<p>不同系统中断向量表不同。</p>
<p>修改代码如下：</p>
<p>将运行地址改为g=0100 0104可以显示出寄存器的值，不执行int 20，但未出现相应符号与Program terminated normally</p>
<p><img src="https://i.loli.net/2021/04/14/rVl4Hn8jcs7Xt6L.png" alt="3"></p>
<p>去掉int 20后程序无法中断：</p>
<p><img src="https://i.loli.net/2021/04/14/rVl4Hn8jcs7Xt6L.png" alt="3"></p>
<p>输入运行起始地址与结束地址后才可运行：</p>
<p><img src="https://i.loli.net/2021/04/14/uvfoZhmyWT8qHzC.png" alt="4"></p>
<p>运用t指令逐条运行，正常运行。</p>
<p>代码解释</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">mov dl,1</span><br><span class="line">将地址1的数据送入目标寄存器DL</span><br><span class="line">int 21</span><br><span class="line">软中断类型21</span><br><span class="line">int 20</span><br><span class="line">中断</span><br></pre></td></tr></table></figure>

<h4 id="2-反汇编程序并查看寄存器值"><a href="#2-反汇编程序并查看寄存器值" class="headerlink" title="2.反汇编程序并查看寄存器值"></a>2.反汇编程序并查看寄存器值</h4><p>输入如下指令</p>
<p><img src="https://i.loli.net/2021/04/14/TLfRkM1alEG3qzw.png" alt="9"></p>
<h4 id="3-命名并写入磁盘"><a href="#3-命名并写入磁盘" class="headerlink" title="3.命名并写入磁盘"></a>3.命名并写入磁盘</h4><p><img src="https://i.loli.net/2021/04/14/vMyru7ijmX1fCQd.png" alt="10"></p>
<p>命令解释:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">-r bx&#x2F;&#x2F;查看寄存器bx</span><br><span class="line">BX 0000</span><br><span class="line">:</span><br><span class="line">-r cx&#x2F;&#x2F;查看寄存器cx并改变值为8</span><br><span class="line">CX 0000</span><br><span class="line">:8</span><br><span class="line">-w&#x2F;&#x2F;将文件或者特定扇区写入磁盘。</span><br><span class="line">Writing 00008 bytes</span><br><span class="line">-q &#x2F;&#x2F;退出</span><br></pre></td></tr></table></figure>

<h4 id="4-查看目录并运行"><a href="#4-查看目录并运行" class="headerlink" title="4.查看目录并运行"></a>4.查看目录并运行</h4><p><img src="https://i.loli.net/2021/04/14/n9YRP3AEDlm1i5p.png" alt="11"></p>
<h4 id="第二段程序-显示所有ASCII码"><a href="#第二段程序-显示所有ASCII码" class="headerlink" title="第二段程序-显示所有ASCII码"></a>第二段程序-显示所有ASCII码</h4><h4 id="1-输入代码"><a href="#1-输入代码" class="headerlink" title="1.输入代码"></a>1.输入代码</h4><p><img src="https://i.loli.net/2021/04/14/wKv2NyhOTYzijSP.png" alt="12"></p>
<p>按照指示输入指令后显示ASCII码。</p>
<p>代码解释：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line">mov cx,0100</span><br><span class="line">mov dl,00</span><br><span class="line">mov ah,02</span><br><span class="line">int 21</span><br><span class="line">inc dl</span><br><span class="line">loop 0105</span><br><span class="line">int 20</span><br><span class="line"></span><br><span class="line">0100传入寄存器cx</span><br><span class="line">00传入寄存器dl</span><br><span class="line">02传入寄存器ah</span><br><span class="line">软中断</span><br><span class="line">dl寄存器+1即00到01</span><br><span class="line">循环，用CX寄存器作为counter，直到cx&#x3D;0000，功能：(CX)&lt;--(CX)-1,(CX)&lt;&gt;0,则转移至标号处循环执行, 直至(CX)&#x3D;0,继续执行后继指令</span><br><span class="line">中断</span><br></pre></td></tr></table></figure>

<p>原因：字符由ASCII码表示，mov ah,02表示调用显示字符的操作，在INT 21表中。</p>
<h4 id="第三段程序-显示字符串"><a href="#第三段程序-显示字符串" class="headerlink" title="第三段程序-显示字符串"></a>第三段程序-显示字符串</h4><p>按照提示输入代码后命名保存，运用db指令查看哪些内容放入内存。</p>
<p><img src="https://i.loli.net/2021/04/14/W6I8DpGPn52vMct.png" alt="13"></p>
<h4 id="第四段程序-显示输入字符"><a href="#第四段程序-显示输入字符" class="headerlink" title="第四段程序-显示输入字符"></a>第四段程序-显示输入字符</h4><p>输入代码</p>
<p><img src="https://i.loli.net/2021/04/14/jsuUoT1kfpExXY7.png" alt="15"></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">0a写入ah，功能缓冲输入 dx&#x3D;缓冲区段</span><br><span class="line"></span><br><span class="line">辅助设备输出 DL&#x3D;要输出的字符（ACSII码）</span><br><span class="line">打印输出	DL&#x3D;要输出的字符（ACSII码）</span><br></pre></td></tr></table></figure>

<p>注意输入字符串应用$结尾。</p>

    </div>
    
    
    

      <footer class="post-footer">
          
          <div class="post-tags">
              <a href="/tags/%E6%B1%87%E7%BC%96/" rel="tag"><i class="fa fa-tag"></i> 汇编</a>
              <a href="/tags/debug/" rel="tag"><i class="fa fa-tag"></i> debug</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2021/04/14/grahp/" rel="prev" title="图的遍历">
      <i class="fa fa-chevron-left"></i> 图的遍历
    </a></div>
      <div class="post-nav-item">
    <a href="/2021/04/14/c++houjie1/" rel="next" title="侯捷C++高级面向对象上简单笔记">
      侯捷C++高级面向对象上简单笔记 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%AE%9E%E9%AA%8C%E7%8E%AF%E5%A2%83"><span class="nav-number">1.</span> <span class="nav-text">实验环境</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%AE%9E%E9%AA%8C%E7%9B%AE%E7%9A%84"><span class="nav-number">2.</span> <span class="nav-text">实验目的</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%AE%9E%E9%AA%8C%E5%86%85%E5%AE%B9"><span class="nav-number">3.</span> <span class="nav-text">实验内容</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#%E7%AC%AC%E4%B8%80%E6%AE%B5%E7%A8%8B%E5%BA%8F"><span class="nav-number">3.1.</span> <span class="nav-text">第一段程序</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#1-%E6%8C%87%E4%BB%A4%EF%BC%8C%E5%AF%84%E5%AD%98%E5%99%A8%EF%BC%8C%E5%86%85%E5%AD%98%E5%8D%95%E5%85%83%EF%BC%8C%E5%9F%BA%E6%9C%ACDOS%E6%93%8D%E4%BD%9C%E3%80%82"><span class="nav-number">3.2.</span> <span class="nav-text">1.指令，寄存器，内存单元，基本DOS操作。</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#2-%E5%8F%8D%E6%B1%87%E7%BC%96%E7%A8%8B%E5%BA%8F%E5%B9%B6%E6%9F%A5%E7%9C%8B%E5%AF%84%E5%AD%98%E5%99%A8%E5%80%BC"><span class="nav-number">3.3.</span> <span class="nav-text">2.反汇编程序并查看寄存器值</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#3-%E5%91%BD%E5%90%8D%E5%B9%B6%E5%86%99%E5%85%A5%E7%A3%81%E7%9B%98"><span class="nav-number">3.4.</span> <span class="nav-text">3.命名并写入磁盘</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#4-%E6%9F%A5%E7%9C%8B%E7%9B%AE%E5%BD%95%E5%B9%B6%E8%BF%90%E8%A1%8C"><span class="nav-number">3.5.</span> <span class="nav-text">4.查看目录并运行</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E7%AC%AC%E4%BA%8C%E6%AE%B5%E7%A8%8B%E5%BA%8F-%E6%98%BE%E7%A4%BA%E6%89%80%E6%9C%89ASCII%E7%A0%81"><span class="nav-number">3.6.</span> <span class="nav-text">第二段程序-显示所有ASCII码</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#1-%E8%BE%93%E5%85%A5%E4%BB%A3%E7%A0%81"><span class="nav-number">3.7.</span> <span class="nav-text">1.输入代码</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E7%AC%AC%E4%B8%89%E6%AE%B5%E7%A8%8B%E5%BA%8F-%E6%98%BE%E7%A4%BA%E5%AD%97%E7%AC%A6%E4%B8%B2"><span class="nav-number">3.8.</span> <span class="nav-text">第三段程序-显示字符串</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E7%AC%AC%E5%9B%9B%E6%AE%B5%E7%A8%8B%E5%BA%8F-%E6%98%BE%E7%A4%BA%E8%BE%93%E5%85%A5%E5%AD%97%E7%AC%A6"><span class="nav-number">3.9.</span> <span class="nav-text">第四段程序-显示输入字符</span></a></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="Sekla"
      src="/images/avatar.jpg">
  <p class="site-author-name" itemprop="name">Sekla</p>
  <div class="site-description" itemprop="description">Sekla</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">100</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">23</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">14</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/ShenTiao" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;ShenTiao" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:584892986@qq.com" title="E-Mail → mailto:584892986@qq.com" rel="noopener" target="_blank"><i class="fa fa-envelope fa-fw"></i>E-Mail</a>
      </span>
  </div>



      </div>

      <iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=330 height=86 src="//music.163.com/outchain/player?type=2&id=1416875904&auto=0&height=66"></iframe>
      
    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2022</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Sekla</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-area"></i>
    </span>
    <span title="站点总字数">288k</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
    <span title="站点阅读时长">4:22</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://muse.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Muse</a> 强力驱动
  </div>

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  <script size="300" alpha="0.6" zIndex="-1" src="/lib/canvas-ribbon/canvas-ribbon.js"></script>
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/muse.js"></script>


<script src="/js/next-boot.js"></script>




  















  

  
      

<script>
  if (typeof MathJax === 'undefined') {
    window.MathJax = {
      loader: {
        source: {
          '[tex]/amsCd': '[tex]/amscd',
          '[tex]/AMScd': '[tex]/amscd'
        }
      },
      tex: {
        inlineMath: {'[+]': [['$', '$']]},
        tags: 'ams'
      },
      options: {
        renderActions: {
          findScript: [10, doc => {
            document.querySelectorAll('script[type^="math/tex"]').forEach(node => {
              const display = !!node.type.match(/; *mode=display/);
              const math = new doc.options.MathItem(node.textContent, doc.inputJax[0], display);
              const text = document.createTextNode('');
              node.parentNode.replaceChild(text, node);
              math.start = {node: text, delim: '', n: 0};
              math.end = {node: text, delim: '', n: 0};
              doc.math.push(math);
            });
          }, '', false],
          insertedScript: [200, () => {
            document.querySelectorAll('mjx-container').forEach(node => {
              let target = node.parentNode;
              if (target.nodeName.toLowerCase() === 'li') {
                target.parentNode.classList.add('has-jax');
              }
            });
          }, '', false]
        }
      }
    };
    (function () {
      var script = document.createElement('script');
      script.src = '//cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js';
      script.defer = true;
      document.head.appendChild(script);
    })();
  } else {
    MathJax.startup.document.state(0);
    MathJax.texReset();
    MathJax.typeset();
  }
</script>

    

  

<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"debug":false,"model":{"jsonPath":"/live2dw/assets/shizuku.model.json"},"display":{"position":"left","width":250,"height":500},"mobile":{"show":false},"react":{"opacity":0.9},"log":false});</script></body>
</html>

<script type="text/javascript" src="/js/src/love.js"></script>
